home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form Grouping
- Caption = "Report Wizard"
- ClientHeight = 4665
- ClientLeft = 60
- ClientTop = 405
- ClientWidth = 6465
- Icon = "Grouping.frx":0000
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 4665
- ScaleWidth = 6465
- StartUpPosition = 2 'CenterScreen
- Begin VB.CommandButton Command2
- Caption = "h"
- BeginProperty Font
- Name = "Wingdings 3"
- Size = 8.25
- Charset = 2
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 2295
- TabIndex = 13
- Top = 2040
- Width = 495
- End
- Begin VB.CommandButton Command1
- Caption = "i"
- BeginProperty Font
- Name = "Wingdings 3"
- Size = 8.25
- Charset = 2
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 2310
- TabIndex = 12
- Top = 2625
- Width = 495
- End
- Begin VB.CommandButton btnGetField
- Caption = ">"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 2295
- TabIndex = 11
- Top = 900
- Width = 495
- End
- Begin VB.CommandButton btnRemoveField
- Caption = "<"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 2280
- TabIndex = 10
- Top = 1290
- Width = 495
- End
- Begin VB.TextBox txtFields
- Appearance = 0 'Flat
- Height = 3135
- Left = 3120
- MultiLine = -1 'True
- TabIndex = 8
- Top = 360
- Width = 3015
- End
- Begin VB.TextBox txtGroup
- Appearance = 0 'Flat
- ForeColor = &H00FF0000&
- Height = 240
- Index = 0
- Left = 3120
- TabIndex = 9
- Top = 360
- Visible = 0 'False
- Width = 3015
- End
- Begin VB.TextBox Text2
- Height = 3375
- Left = 3000
- TabIndex = 7
- Top = 240
- Width = 3255
- End
- Begin VB.CommandButton btnCancel
- Cancel = -1 'True
- Caption = "Cancel"
- Height = 375
- Left = 1800
- TabIndex = 6
- Top = 4200
- Width = 975
- End
- Begin VB.CommandButton btnBack
- Caption = "< &Back"
- Height = 375
- Left = 2985
- TabIndex = 5
- Top = 4200
- Width = 975
- End
- Begin VB.CommandButton btnNext
- Caption = "&Next >"
- Height = 375
- Left = 3975
- TabIndex = 4
- Top = 4200
- Width = 975
- End
- Begin VB.CommandButton btnFinish
- Caption = "&Finish"
- Height = 375
- Left = 5160
- TabIndex = 3
- Top = 4200
- Width = 975
- End
- Begin VB.TextBox Text1
- BackColor = &H80000003&
- Height = 3615
- Left = 2880
- TabIndex = 2
- Top = 120
- Width = 3495
- End
- Begin VB.ListBox lstFields
- Height = 2205
- Left = 120
- TabIndex = 1
- Top = 720
- Width = 2070
- End
- Begin VB.Line Line4
- BorderColor = &H80000005&
- X1 = 105
- X2 = 6345
- Y1 = 3975
- Y2 = 3975
- End
- Begin VB.Line Line3
- BorderColor = &H80000003&
- X1 = 105
- X2 = 6345
- Y1 = 3960
- Y2 = 3960
- End
- Begin VB.Label Label2
- Caption = "Priority"
- Height = 240
- Left = 2310
- TabIndex = 14
- Top = 2355
- Width = 555
- End
- Begin VB.Label Label1
- Caption = "Do you want to add any grouping levels?"
- Height = 495
- Left = 120
- TabIndex = 0
- Top = 120
- Width = 2415
- End
- Attribute VB_Name = "Grouping"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Dim NumGroups As Integer
- Private Sub btnGetField_Click()
- Call AddGroup
- End Sub
- Private Sub btnNext_Click()
- Grouping.Hide
- Sorting.Show 1
- End Sub
- Private Sub btnRemoveField_Click()
- Dim x As Integer
- Dim RemovedGroup As Integer
- Dim Found As Boolean
- Found = False
- For x = 0 To NumGroups - 1
- If txtGroup(x).FontBold = True Then
- Found = True
- RemovedGroup = x
- End If
- If Found Then
- If x < NumGroups - 1 Then
- txtGroup(x).Text = txtGroup(x + 1).Text
- End If
- End If
- Next x
- For x = 1 To SQL.Groups.Count
- If SQL.Groups.Item(x).Name = txtGroup(NumGroups - 1).Text Then
- SQL.Groups.Remove x
- End If
- Next x
- txtFields.Left = txtFields.Left - 200
- txtFields.Width = txtFields.Width + 200
- If NumGroups - 1 > 0 Then
- txtFields.Top = txtGroup(NumGroups - 2).Top + txtGroup(NumGroups - 2).Height + 30
- Else
- txtFields.Top = txtGroup(NumGroups - 1).Top
- End If
- txtFields.Height = txtFields.Height + txtGroup(NumGroups - 1).Height
-
- If NumGroups - 1 > 0 Then
- Unload txtGroup(NumGroups - 1)
- Else
- txtGroup(NumGroups - 1).Visible = False
- End If
-
- NumGroups = NumGroups - 1
- End Sub
- Private Sub Form_Load()
- Dim NumFields As Integer
- Dim FieldList As String
- NumGroups = 0
- ' Move the all selected fields from previous tab to the field list.
- For NumFields = 0 To SelectFields.lstSelectedFields.ListCount - 1
- SelectFields.lstSelectedFields.ListIndex = NumFields
- lstFields.AddItem SelectFields.lstSelectedFields.Text
-
- FieldList = FieldList & SelectFields.lstSelectedFields.Text & ", "
- Next NumFields
- FieldList = Left(FieldList, Len(FieldList) - 2)
- txtFields.Text = FieldList
- End Sub
- Private Sub lstFields_DblClick()
- Call AddGroup
- End Sub
- Private Sub txtGroup_GotFocus(Index As Integer)
- ' Change all groups to be non bold text.
- For x = 0 To NumGroups - 1
- txtGroup(x).FontBold = False
- Next x
- ' Change the group that has focus to be bold.
- txtGroup(Index).FontBold = True
- End Sub
- Public Sub AddGroup()
- Dim x As Integer
- NumGroups = NumGroups + 1
- If NumGroups > 1 Then
- Load txtGroup(NumGroups - 1)
- txtGroup(NumGroups - 1).Left = txtGroup(NumGroups - 2).Left + 200
- txtGroup(NumGroups - 1).Width = txtGroup(NumGroups - 2).Width - 200
- txtGroup(NumGroups - 1).Top = txtGroup(NumGroups - 2).Top + txtGroup(NumGroups - 2).Height + 30
- txtGroup(NumGroups - 1).Height = txtGroup(NumGroups - 2).Height
- txtGroup(NumGroups - 1).ZOrder 0
- End If
- For x = 0 To NumGroups - 1
- txtGroup(x).FontBold = False
- Next x
- txtGroup(NumGroups - 1).Visible = True
- txtGroup(NumGroups - 1).Text = lstFields.Text
- txtGroup(NumGroups - 1).FontBold = True
- txtFields.Left = txtFields.Left + 200
- txtFields.Width = txtFields.Width - 200
- txtFields.Top = txtGroup(NumGroups - 1).Top + txtGroup(NumGroups - 1).Height + 30
- txtFields.Height = txtFields.Height - txtGroup(NumGroups - 1).Height
- SQL.Groups.Add lstFields.Text, lstFields.Text
- End Sub
-